import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:les/common/Printer.dart';
import 'package:flutter/cupertino.dart';

void main(){
  runApp(
      MyApp()
  );
}

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'default',
      theme: defaultTheme,
      home: MainPage(),
    );
  }
}

class MainPage extends StatefulWidget{
  @override
  MainPageState createState()  => MainPageState();
}

class MainPageState extends State<MainPage>{
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter调用原生Android的方法',
      debugShowCheckedModeBanner: false,
      home: Scaffold(
          appBar: AppBar(
            title: Text('Flutter调用原生Android的Java方法'),
          ),
          body: Center(
              child:
              RaisedButton(
                child:
                Padding(
                  padding: EdgeInsets.only(left: 20,right: 20,top: 20,bottom: 20),
                  child: Text('点击按钮调用原生Android的Java方法\n，返回值在控制台输出'),
                ),

                onPressed: ()async{
                  Printer.printCmds("11",["111","222"]);
                },
              )
          )
      ),
    );
  }
}

final ThemeData defaultTheme = ThemeData(
    primaryColor: Colors.lightBlue
);